home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Hacks / Hacks ’95 / Menu Controls / UPictShape.h < prev    next >
Encoding:
Text File  |  1995-06-24  |  1.7 KB  |  73 lines  |  [TEXT/MPS ]

  1. // Copyright © 1994-95 by Apple Computer, Inc. All rights reserved.
  2. // UPictShape.h
  3.  
  4. #ifndef __UPICTSHAPE__
  5. #define __UPICTSHAPE__
  6.  
  7. #ifndef __UDIALOG__
  8. #include <UDialog.h>
  9. #endif
  10.  
  11. #ifndef __USHAPES__
  12. #include "UShapes.h"
  13. #endif
  14.  
  15. //----------------------------------------------------------------------------------------
  16. // TDocPicture: Version of TPicture that works for picture handles that are part of the
  17. // document (not resources). 
  18. //----------------------------------------------------------------------------------------
  19.  
  20. class TDocPicture : public TPicture
  21. {
  22.     MA_DECLARE_CLASS;
  23.     
  24. public:
  25.     TDocPicture();
  26.         // Constructor
  27.         
  28.     virtual void ReleasePicture(); // override
  29.         // Releases the PICT by disposing of fDataHandle.
  30. };
  31.  
  32.  
  33. //--------------------------------------------------------------------------------------------------
  34. // CLASS TPictShape
  35. //--------------------------------------------------------------------------------------------------
  36.  
  37. class TPictShape : public TShape
  38. {
  39.     MA_DECLARE_CLASS;
  40.  
  41.   public:
  42.     TPictShape();
  43.     void IPictShape(const CRect& itsExtent, short itsID);
  44.     
  45.     virtual void DoInitialState(TShapeView* itsView); // Override
  46.  
  47.     void CreatePicture(TView* itsView);
  48.     void SetPictureFrame();
  49.  
  50.     virtual TObject* Clone();    // Override
  51.  
  52.     virtual void Free();    // Override
  53.     
  54.     virtual void ReadFrom(TStream* aStream);    // Override
  55.     virtual void WriteTo(TStream* aStream);        // Override
  56.  
  57.     void SetPicture(PicHandle pictData);
  58.     
  59.     virtual void BeInView(TShapeView* itsView);    // Override
  60.  
  61.     virtual void Draw();    // Override
  62.     void DrawInsides(const CRect& extent);
  63.     void DrawOutline();
  64.  
  65.     virtual void SetFrame(const CRect& extentRect); // override
  66.  
  67.   private:
  68.     TDocPicture*    fPicture;
  69.     PicHandle        fPictData;
  70. };
  71.  
  72. #endif
  73.